<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>我的会员</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
		
		<style type="text/css">
				
		td
		{
			width: 25%;
		white-space: nowrap;
		overflow:hidden;
		text-align: -webkit-center;
		height: 15px;
		}
		.tablex{
			width: 100%;
		}
		
		</style>
		
</head>
<body onload="dlceng1(),dlceng2(),dlceng3(),dlceng4(),dlceng5()">
    <section class="aui-content-padded">
        <ul class="aui-list aui-collapse aui-border">
            <div class="aui-collapse-item">
                <li class="aui-list-item aui-collapse-header" tapmode>
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-titlex" id="wodehy"> 我的团队</div>
                        <!-- <div class="aui-list-item-right">
                            <i class="aui-iconfont aui-icon-down aui-collapse-arrow"></i>
                        </div> -->
                    </div>
                </li>
                
            </div>
            <div class="aui-collapse-item">


				<!-- ////3//// -->
				<li class="aui-list-item aui-collapse-header" tapmode>
					<div class="aui-list-item-inner">
						<div class="aui-list-item-title" id="ccengrs">我的会员</div>
						<div class="aui-list-item-right">
							<i class="aui-iconfont aui-icon-down aui-collapse-arrow"></i>
						</div>
					</div>
				</li>
				<div class="aui-collapse-content" id="cengc">
					<li class="aui-list-item">
					
					</li>
				</div>
				

      </div>
			

				
     </ul>
    </section>
		
		
</body>
<script type="text/javascript" src="../script/api.js" ></script>
<script type="text/javascript" src="../script/aui-collapse.js" ></script>
<script type="text/javascript">
	var userid = localStorage.getItem('user_id');
    apiready = function () {
        api.parseTapmode();
				
		    api.ajax({
		        url: 'http://maibao.z907.com/login/login/tuanduirs.html',
		        method: 'get',
		        data: {
		            values: {
		                uid: userid
		            }
		        }
		    },function(ret, err){
		        if (ret) {
							
		            var sign = $api.byId('sign');
					var tdzrsx = $api.byId('wodehy');
					var huiy1 = $api.byId('acengrs');
					var huiy2 = $api.byId('bcengrs');
					var huiy3 = $api.byId('ccengrs');
					var huiy4 = $api.byId('dcengrs');
					var huiy5 = $api.byId('ecengrs');
					
					var tdrsbl = ret.msg['tdzrs'];
					var tdrsbl1 = ret.msg['oneceng'];
					var tdrsbl2 = ret.msg['twoceng'];
					var tdrsbl3 = ret.msg['threeceng'];
					var tdrsbl4 = ret.msg['siceng'];
					var tdrsbl5 = ret.msg['wuceng'];
		      
					tdzrsx.innerHTML = '我的会员：共'+tdrsbl+'人';
					huiy1.innerHTML = '一级会员'+tdrsbl1+'人';
					huiy2.innerHTML = '二级会员'+tdrsbl2+'人';
					huiy3.innerHTML = '三级会员'+tdrsbl3+'人';
					huiy4.innerHTML = '四级会员'+tdrsbl4+'人';
					huiy5.innerHTML = '五级会员'+tdrsbl5+'人';
		
		        } else {
		          api.hideProgress();
		            alert('网络错误11');
		        }
		    });
				
		} 
		
				 /* api.ajax({
		        url: 'http://maibao.z907.com/login/login/tdbiao.html',
		        method: 'get',
		        data: {
		            values: {
		                uid: localStorage.getItem('user_id')
		            }
		        }
		    },function(ret, err){
		        if (ret) {
		            var tdbiaox = $api.byId('tdbiao');
		            tdbiaox.innerHTML = ret.msg['tdsyr'];
		
		        } else {
		          api.hideProgress();
		            alert('网络错误11');
		        }
		    }); */

   
                 var collapse = new auiCollapse({
                     autoHide:true //是否自动隐藏已经展开的容器
                 });
		
		
		/* function load(){
					var ajax = new XMLHttpRequest();
					ajax.open('post','http://maibao.z907.com/appx/daili.php');
					ajax.setRequestHeader("Content-type","application/x-www-form-urlencoded");
					var userid = localStorage.getItem('user_id');
					var student = new Object(); 
					student.id = userid; 
					
					var json = JSON.stringify(student); 
					ajax.send('json='+json);
					ajax.onreadystatechange = function(){
						if (ajax.readyState ==4&&ajax.status==200) {
								console.log(ajax.responseText);
								var show = document.querySelector('#tishi');
								var neirx = document.querySelector('#neir');
										show.style.display='block';
										var data =ajax.responseText;
											var result=eval("("+data+")");
											function sjcl(timex){
											var d = new Date(timex * 1000);
											timex=d.toISOString();
											var pattern2 = ".000Z";
											timex = timex.replace(new RegExp(pattern2), "");
											timex = timex.replace(/T/, " ");
											timex = timex.substring(5,10);
												return(timex);
												} 	 
												var shuchu ='';
												var moneyx =0;
											for(var i=0;i<result.length;i++){
										var qiantb ='<table class="tablex">'+'<tr><th>用户名</th><th>时间</th><th>等级</th><th>金额</th></tr>';
										var houtb =' </table>';
										var str= '<tr>'+'<td>'+'<font size=4>'+result[i][2]+'</font>'+'</td>'+
														'<td>'+sjcl(result[i][1])+'</td>'+
														'<td>'+result[i][3]+'级代理返'+'</td>'+
														'<td>'+'<font color=red>'+result[i][4]+'元</font>'+'</td>'+'</tr>';
														shuchu += str;
														moneyx = moneyx + Number(result[i][4]);
														} 	
														var shuchu =qiantb+shuchu+houtb;
														neirx.innerHTML=shuchu;
														
			var con=result.length;
			localStorage.setItem('tud',con); 
			if (con==0){
				show.innerHTML='啊奥!您有'+ con+'位下级代理  '+'共获得0元';	
			}else{
			show.innerHTML='恭喜!您有'+ con+'位下级代理  '+'共获得'+moneyx+'元';		
				} 
				
				}
		
			};	    	
		} */
		
		//--------------------------------1------------------------
		
		function dlceng1(){
					var ajax = new XMLHttpRequest();
					ajax.open('post','http://maibao.z907.com/appx/xjdl1.php');
					ajax.setRequestHeader("Content-type","application/x-www-form-urlencoded");
					var userid = localStorage.getItem('user_id');
					var student = new Object(); 
					student.id = userid; 
					var json = JSON.stringify(student); 
					ajax.send('json='+json);
					ajax.onreadystatechange = function(){
						if (ajax.readyState ==4&&ajax.status==200) {
								console.log(ajax.responseText);
								// var show1 = document.querySelector('#tishi1');
								var cengax = document.querySelector('#cenga');
										// show1.style.display='block';
										var data =ajax.responseText;
											var result=eval("("+data+")");
											function sjcl(timex){
											var d = new Date(timex * 1000);
											timex=d.toISOString();
											var pattern2 = ".000Z";
											timex = timex.replace(new RegExp(pattern2), "");
											timex = timex.replace(/T/, " ");
											timex = timex.substring(0,10);
												return(timex);
												} 	 
												var shuchu ='';
												var moneyx =0;
											for(var i=0;i<result.length;i++){
										var str= '<li class="aui-list-item">'+'<div class="aui-list-item-titles">'+'<font size=4>'+result[i][2]+'</font>'+'</div>'+
														'<div class="aui-list-item-titles">'+sjcl(result[i][1])+'&nbsp;&nbsp;&nbsp;</div>'+'</li>';
														shuchu += str;
														} 	
														var shuchu =shuchu;
														cengax.innerHTML=shuchu;
				                          }
			                        };	    	
		                     }
					//--------------------------------2------------------------
					
					function dlceng2(){
								var ajax = new XMLHttpRequest();
								ajax.open('post','http://maibao.z907.com/appx/xjdl2.php');
								ajax.setRequestHeader("Content-type","application/x-www-form-urlencoded");
								var userid = localStorage.getItem('user_id');
								var student = new Object(); 
								student.id = userid; 
								var json = JSON.stringify(student); 
								ajax.send('json='+json);
								ajax.onreadystatechange = function(){
									if (ajax.readyState ==4&&ajax.status==200) {
											console.log(ajax.responseText);
											var cengbx = document.querySelector('#cengb');
													var data =ajax.responseText;
														var result=eval("("+data+")");
														function sjcl(timex){
														var d = new Date(timex * 1000);
														timex=d.toISOString();
														var pattern2 = ".000Z";
														timex = timex.replace(new RegExp(pattern2), "");
														timex = timex.replace(/T/, " ");
														timex = timex.substring(0,10);
															return(timex);
															} 	 
															var shuchu ='';
															var moneyx =0;
														for(var i=0;i<result.length;i++){
													var str= '<li class="aui-list-item">'+'<div class="aui-list-item-titles">'+'<font size=4>'+result[i][2]+'</font>'+'</div>'+
																	'<div class="aui-list-item-titles">'+sjcl(result[i][1])+'&nbsp;&nbsp;&nbsp;</div>'+'</li>';
																	shuchu += str;
																	} 	
																	var shuchu =shuchu;
																	cengbx.innerHTML=shuchu;
																				}
																		};	    	
															}
					//--------------------------------3------------------------
					
					function dlceng3(){
								var ajax = new XMLHttpRequest();
								ajax.open('post','http://maibao.z907.com/appx/xjdl3.php');
								ajax.setRequestHeader("Content-type","application/x-www-form-urlencoded");
								var userid = localStorage.getItem('user_id');
								var student = new Object(); 
								student.id = userid; 
								var json = JSON.stringify(student); 
								ajax.send('json='+json);
								ajax.onreadystatechange = function(){
									if (ajax.readyState ==4&&ajax.status==200) {
											console.log(ajax.responseText);
											var cengcx = document.querySelector('#cengc');
													var data =ajax.responseText;
														var result=eval("("+data+")");
														function sjcl(timex){
														var d = new Date(timex * 1000);
														timex=d.toISOString();
														var pattern2 = ".000Z";
														timex = timex.replace(new RegExp(pattern2), "");
														timex = timex.replace(/T/, " ");
														timex = timex.substring(0,10);
															return(timex);
															} 	 
															var shuchu ='';
															var moneyx =0;
														for(var i=0;i<result.length;i++){
													var str= '<li class="aui-list-item">'+'<div class="aui-list-item-titles">'+'<font size=4>'+result[i][2]+'</font>'+'</div>'+
																	'<div class="aui-list-item-titles">'+sjcl(result[i][1])+'&nbsp;&nbsp;&nbsp;</div>'+'</li>';
																	shuchu += str;
																	} 	
																	var shuchu =shuchu;
																	cengcx.innerHTML=shuchu;
																				}
																		};	    	
															}
					//--------------------------------4------------------------
					
					function dlceng4(){
								var ajax = new XMLHttpRequest();
								ajax.open('post','http://maibao.z907.com/appx/xjdl4.php');
								ajax.setRequestHeader("Content-type","application/x-www-form-urlencoded");
								var userid = localStorage.getItem('user_id');
								var student = new Object(); 
								student.id = userid; 
								var json = JSON.stringify(student); 
								ajax.send('json='+json);
								ajax.onreadystatechange = function(){
									if (ajax.readyState ==4&&ajax.status==200) {
											console.log(ajax.responseText);
											var cengdx = document.querySelector('#cengd');
													var data =ajax.responseText;
														var result=eval("("+data+")");
														function sjcl(timex){
														var d = new Date(timex * 1000);
														timex=d.toISOString();
														var pattern2 = ".000Z";
														timex = timex.replace(new RegExp(pattern2), "");
														timex = timex.replace(/T/, " ");
														timex = timex.substring(0,10);
															return(timex);
															} 	 
															var shuchu ='';
															var moneyx =0;
														for(var i=0;i<result.length;i++){
													var str= '<li class="aui-list-item">'+'<div class="aui-list-item-titles">'+'<font size=4>'+result[i][2]+'</font>'+'</div>'+
																	'<div class="aui-list-item-titles">'+sjcl(result[i][1])+'&nbsp;&nbsp;&nbsp;</div>'+'</li>';
																	shuchu += str;
																	} 	
																	var shuchu =shuchu;
																	cengdx.innerHTML=shuchu;
																				}
																		};	    	
															}
					//--------------------------------5------------------------
					
					function dlceng5(){
								var ajax = new XMLHttpRequest();
								ajax.open('post','http://maibao.z907.com/appx/xjdl5.php');
								ajax.setRequestHeader("Content-type","application/x-www-form-urlencoded");
								var userid = localStorage.getItem('user_id');
								var student = new Object(); 
								student.id = userid; 
								var json = JSON.stringify(student); 
								ajax.send('json='+json);
								ajax.onreadystatechange = function(){
									if (ajax.readyState ==4&&ajax.status==200) {
											console.log(ajax.responseText);
											var cengex = document.querySelector('#cenge');
													var data =ajax.responseText;
														var result=eval("("+data+")");
														function sjcl(timex){
														var d = new Date(timex * 1000);
														timex=d.toISOString();
														var pattern2 = ".000Z";
														timex = timex.replace(new RegExp(pattern2), "");
														timex = timex.replace(/T/, " ");
														timex = timex.substring(0,10);
															return(timex);
															} 	 
															var shuchu ='';
															var moneyx =0;
														for(var i=0;i<result.length;i++){
													var str= '<li class="aui-list-item">'+'<div class="aui-list-item-titles">'+'<font size=4>'+result[i][2]+'</font>'+'</div>'+
																	'<div class="aui-list-item-titles">'+sjcl(result[i][1])+'&nbsp;&nbsp;&nbsp;</div>'+'</li>';
																	shuchu += str;
																	} 	
																	var shuchu =shuchu;
																	cengex.innerHTML=shuchu;
																				}
																		};	    	
															}
					
</script>
</html>